//
//  NewsCell.m
//  witMorning
//
//  Created by 信晨汇 on 2018/1/5.
//  Copyright © 2018年 zt. All rights reserved.
//

#import "NewsCell.h"
#import "UIColor+Hex.h"
@implementation NewsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        
        UIView *cusView = [[UIView alloc]initWithFrame:CGRectMake(0, 5, SCREEN_W, 90)];
        cusView.backgroundColor = [UIColor colorWithHexString:@"#f5f5f5"];
        cusView.layer.shadowOffset = CGSizeMake(5, 2);
        cusView.layer.shadowColor = [UIColor grayColor].CGColor;
        cusView.layer.shadowOpacity = 0.5;//阴影透明度，默认0
        cusView.layer.shadowRadius = 2;//阴影半径，默认3
        [self.contentView addSubview:cusView];
        
        
        UIView *iconView = [[UIView alloc]initWithFrame:CGRectMake(20, 20, 50, 50)];
        iconView.backgroundColor = [UIColor colorWithHexString:@"#43aef2"];
        iconView.layer.cornerRadius = 5;
        iconView.clipsToBounds = YES;
        [cusView addSubview:iconView];
        
        
        
        _iconImage = [[UIImageView alloc]initWithFrame:CGRectMake(13, 13, 25, 25)];
        _iconImage.image = [UIImage imageNamed:@"information"];
        [iconView addSubview:self.iconImage];
        
        
        _numberLabel = [[UILabel alloc]initWithFrame:CGRectMake(70-15, 15, 20, 20)];
        _numberLabel.backgroundColor = [UIColor redColor];
        _numberLabel.layer.cornerRadius = 10;
        _numberLabel.clipsToBounds = YES;
        _numberLabel.text = @"5";
        _numberLabel.textAlignment = NSTextAlignmentCenter;
        _numberLabel.font = [UIFont systemFontOfSize:14];
        _numberLabel.textColor = [UIColor whiteColor];
        [cusView addSubview:self.numberLabel];
        
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(100, 20, 200, 20)];
        _titleLabel.text = @"通知消息";
        [_titleLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16]];
        [cusView addSubview:self.titleLabel];
        
        _typeLabel = [[UILabel alloc]initWithFrame:CGRectMake(100, 50, 200, 20)];
        _typeLabel.text = @"会议有更新";
        _typeLabel.font = [UIFont systemFontOfSize:14];
        _typeLabel.textColor = [UIColor grayColor];
        [cusView addSubview:self.typeLabel];
        
        
    }
    
    
    return self;
    
}

@end
